package com.hu.video.mapper;

import com.hu.video.entity.UserPrivacySettings;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserPrivacySettingsMapper {
    @Select("SELECT * FROM user_privacy_settings WHERE user_id = #{userId}")
    UserPrivacySettings selectByUserId(Long userId);

    @Insert("INSERT INTO user_privacy_settings (user_id, online_status, stranger_view_videos, create_time, update_time) VALUES (#{userId}, #{onlineStatus}, #{strangerViewVideos}, NOW(), NOW())")
    int insert(UserPrivacySettings settings);

    @Update("UPDATE user_privacy_settings SET online_status = #{onlineStatus}, stranger_view_videos = #{strangerViewVideos}, update_time = NOW() WHERE user_id = #{userId}")
    int update(UserPrivacySettings settings);
} 